﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TravianAutoQueue.DomainModel;
using TravianMiniBot.Entities;
using TravianMiniBot.ViewData;

namespace TravianMiniBot
{
    public class UIServices
    {
        public List<VillageDropdownItem> ConvertvillageForDropdownLists(List<Village> villages)
        {
            var results = new List<VillageDropdownItem>();
            foreach(var village in villages)
            {
                var item = new VillageDropdownItem();
                item.Village = village;
                item.Text = string.Format("{0} ({1}|{2}) [{3}]", village.Name, village.X, village.Y, village.TravianId);
                results.Add(item);
            }
            return results;
        }

        public List<QueueGridItem> ConvertToQueueGridItem(List<QueueItem> queue)
        {
            return  (from item in queue select new QueueGridItem(item)).ToList() ;

        }


    }
}
